package net.wzw.mapper.db_counter;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.wzw.model.FoodCounterDO;
import net.wzw.vo.FoodCounterVO;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.repository.query.Param;

import java.util.Date;
import java.util.List;

/**
 * @author wzw
 * @date 2025/5/1
 * @Description
 */
public interface FoodCounterMapper extends BaseMapper<FoodCounterDO> {

       /**
        * 新增计数数据 这里可以改成对象那种
        * @param foodId
        * @param countKey
        * @param countValue
        * @param lastCountValue
        */
       void addFoodCounter(@Param(value = "food_id") Integer foodId,
                           @Param(value = "count_key") String countKey,
                           @Param(value= "count_value")  Integer countValue,
                           @Param(value = "last_count_value") Integer lastCountValue,
                           @Param(value = "create_time") Date createTime);

       /**
        * 查询food_id 是否存在对应计数
        * **/
       int getFoodById(@Param(value = "food_id") Integer foodId,@Param(value = "count_key") String countKey);

       /**
        * 查询food_id 对应计数
        *
       */
       List<FoodCounterVO> getFoodCountersById(@Param(value = "food_id") Integer foodId);

}
